package com.chenjt.netty.fourteen_stickyAndUnpackPackage.solve.server;

import com.chenjt.netty.fourteen_stickyAndUnpackPackage.solve.MyPersonDecoder;
import com.chenjt.netty.fourteen_stickyAndUnpackPackage.solve.MyPersonEncoder;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;

/**
 * 注释：
 *
 * @author chenjt
 * @date 2024/9/9 10:35
 */
public class MyServerInitializer extends ChannelInitializer<SocketChannel> {
    @Override
    protected void initChannel(SocketChannel ch) throws Exception {
        ChannelPipeline pipeline = ch.pipeline();

        pipeline.addLast(new MyPersonDecoder());
        pipeline.addLast(new MyPersonEncoder());

        pipeline.addLast(new MyServerHandler());

    }
}
